package com.eling.elcms.community.dao.hibernate;

import com.eling.elcms.community.dao.IDepartmentDao;
import com.eling.elcms.community.model.Department;
import com.eling.elcms.core.dao.hibernate.GenericDaoHibernate;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Repository
public class DepartmentDaoHibernate extends GenericDaoHibernate<Department, Long> implements IDepartmentDao {

    public DepartmentDaoHibernate() {
        super(Department.class);
    }
    
    public Department add(@RequestBody Department department) {
    	return this.save(department);
    }
    
    public void delete(@RequestBody Department department) {
    	this.remove(department);
    }
    
    public Department update(@RequestBody Department department) {
    	return this.save(department);
    }
    
    public List<Department> queryAll(@RequestBody Department department) {
    	return this.getAll();
    }

    

}
